#!/bin/sh

echo "[INFO] 启动 spring-mcp-server.jar..."
java -jar /app/mcp-server/mcp-server-0.0.1.jar --spring.profiles.active=prod --spring.config.location=classpath:/,/app/mcp-server/application-prod.yml &

# 等待 30 秒
sleep 30

# ws 客户端
echo "[INFO] 启动 spring-mcp-client-ws.jar..."
exec java -jar /app/mcp-client-ws/mcp-client-ws-0.0.1.jar --spring.profiles.active=prod --spring.config.location=classpath:/,/app/mcp-client-ws/application-prod.yml &

# http 客户端
#echo "[INFO] 启动 spring-mcp-client.jar..."
#exec java -jar /app/mcp-client/mcp-client-0.0.1.jar --spring.profiles.active=prod --spring.config.location=classpath:/,/app/mcp-client/application-prod.yml &

# 等待所有后台程序退出（防止容器退出）
wait